package Morning;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class Generic02 {


    public static void main(String[] args) {

        Set<String> stu = new HashSet<>();

        stu.add("张三");
        stu.add("王五");
        stu.add("李四");
        stu.add("玩儿");

        Iterator<String> iterator = stu.iterator();
        while (iterator.hasNext()) {

            System.out.println(iterator.next());
        }


        System.out.println("-----------------------");
        for (String s : stu) {
            System.out.println(s);
        }
    }
}
